home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 46
/
Aminet 46 (2001)(GTI - Schatztruhe)[!][Dec 2001].iso
/
Aminet
/
text
/
edit
/
edt10src.lha
/
txt
/
Keymapping.mod
< prev
next >
Wrap
Text File
|
1995-04-09
|
2KB
|
82 lines
(*
.name RxKeymapping
.task keymapping with arexx
.release 1.0
.language Oberon-2
.translator Amiga Oberon 3.2
.system req. AmigaOS 2.04 or higher
.author Joachim Barheine
.address Hochgrevestr. 3
.copyright (c) 1995 by J.Barheine
*)
(* .info: 28/03/95, 17:33:00, version 2 *)
MODULE Keymapping;
IMPORT
ASCII,
CN:= CmdNodes,
IO:= IOServer,
K:= Kernel,
Rx:= ERexx,
S:= Strings,
Str:= StrPool,
T:= Texts,
W:= Windows;
VAR
keyInfo: K.DynArray;
PROCEDURE* DoKey(w: IO.Window; id: INTEGER): SHORTINT;
VAR
n: CN.CmdNode;
t: IO.Text;
BEGIN
n:= keyInfo.Get(id)(CN.CmdNode);
IF CN.ExecRexx(w(W.Window), n.string^, n.isFile) THEN
IF n.global THEN t:= NIL ELSE t:= w.text END;
IO.ToggleItem(t, n.itemID);
RETURN CN.HandleRexx(w(W.Window));
ELSE
RETURN IO.msgLocal;
END;
END DoKey;
PROCEDURE SetRawKey* (code: INTEGER; qual: SHORTSET; cmdStr: ARRAY OF CHAR;
isFile: BOOLEAN; itemID: INTEGER; global: BOOLEAN);
VAR
str: K.DynString;
(* $CopyArrays- *)
BEGIN
NEW(str, S.Length(cmdStr) + 1);
COPY(cmdStr, str^);
keyInfo.Put(CN.CreateNode(str, itemID, isFile, global),
IO.SetRawKey(code, qual, DoKey));
END SetRawKey;
PROCEDURE SetANSIKey* (c: CHAR; qual: SHORTSET; cmdStr: ARRAY OF CHAR;
isFile: BOOLEAN; itemID: INTEGER; global: BOOLEAN);
VAR
str: K.DynString;
(* $CopyArrays- *)
BEGIN
NEW(str, S.Length(cmdStr) + 1);
COPY(cmdStr, str^);
keyInfo.Put(CN.CreateNode(str, itemID, isFile, global),
IO.SetANSIKey(c, qual, DoKey));
END SetANSIKey;
BEGIN
keyInfo.New(20, 10);
END Keymapping.